<template>
  <div class="home">
    dayjs: {{time}}
    <br />
    vuex: {{count}}
    <a href @click.prevent="oIncrement">点我增加Vuex值</a>
  </div>
</template>

<script>
// @ is an alias to /src
import dayjs from "dayjs";

export default {
  name: "home",
  data() {
    return {
      time: null
    };
  },
  computed: {
    count() {
      return this.$store.state.count;
    }
  },
  methods: {
    oIncrement() {
      this.$store.dispatch("increment");
    }
  },
  created() {
    this.time = dayjs().format("YYYY-MM");
  }
};
</script>
